<?php
/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * Forum Application Controller: Board / Section / Forum, wtv
 * Started: Mon Oct 27, 2009 7:23 PM
 * Script version: 1.0
 */
class board{
	public function __construct($id){
		global $_CF;
		$this->bid = intval($id);
		$this->query = $_CF->db->select("boards", "*", "1", " WHERE `id` = '{$this->bid}'");
		if(!$this->query){
			$this->status = false;
		}
		else{
			$this->status = true;
			$this->board = $_CF->db->fetch_array($this->query);
		}
	}
	
	public function getStatus(){
		return $this->status;
	}
	
	public function getTitle(){
		return $this->board['title'];
	}
	
	public function getID(){
		return $this->board['id'];
	}
	
	public function getOrder(){
		return $this->board['order'];
	}
	
	public function getDesc(){
		return $this->board['desc'];
	}
	
	public function getRelCat(){
		return $this->board['relcat'];
	}

	public function delete(){
		global $db;
		$query = $db->query("DELETE FROM `".DB_PREFIX."boards` WHERE `id` = {$this->bid} LIMIT 1");
		return $query;
	}
}
